#
#===============================================================================
#
#         FILE:  Config.pm
#
#  DESCRIPTION:  A module for storing hashes that will be loaded into the
#  %CONFIG variable used within mailguard.  The only supported routine is a
#  routine to look up a hash name "DEV" or "PROD" or "DEV2", turn that into %DEV
#  by the 'eval' routine, and then return that has as a reference to the caller.
#
#===============================================================================

package EMS::Mailguard::Config;

my $MGDIR="%%MGPATH%%";

%_DEMO = (
               # A file that explains the structure of the blurbs, of configuration
               # parameters when sending mail out under some of the mailguard "cases"
               'xmlfile' => "$MGDIR/mailguard/demo_etc/mailguard_conf.xml",

               # The standard logfile location
               'logfile' => "$MGDIR/mailguard/log/mailguard.demo.log",

               # Where inbound messages are stored ( synonyms )
               'queue_path' => "$MGDIR/mailguard/queue",
               'storedir'   => "$MGDIR/mailguard/queue",

               # Domains you recognize or relay for
               # the domain that mail from mailguard is addressed from.
               'our_domain' => ['demodomain.com'],

               # Domains you recognize or relay for
               'our_ext_domain' => ['external.demodomain.com'],

               # Database where information about the particular configuration of lists
               # is stored
               'list_db' => "$MGDIR/mailguard/demo_etc/lists.db",

               #LDAP information
               'ldap_host' => 'ldap.demodomain.com',

               # Basename, typically used for logging
               'basename' => "mailguard",
               'progname' => 'Mailguard 2.0 - Public',
              );

%_PROD = (
               # A file that explains the structure of the blurbs, of configuration
               # parameters when sending mail out under some of the mailguard "cases"
               'xmlfile' => "$MGDIR/mailguard/etc/mailguard_conf.xml",

               # The standard logfile location
               'logfile' => "$MGDIR/mailguard/log/mailguard.log",

               # Where inbound messages are stored ( synonyms )
               'queue_path' => "$MGDIR/mailguard/queue",
               'storedir'   => "$MGDIR/mailguard/queue",

               # Domains you recognize or relay for.  The first entry will be
               # the domain that mail from mailguard is addressed from.
               'our_domain' => ['demodomain.com'],

               # Domains whose addresses got munged
               'our_ext_domain' => ['external.demodomain.com'],

               # Database where information about the particular configuration of lists
               # is stored
               'list_db' => '$MGDIR/mailguard/etc/lists.db',

               #LDAP information
               'ldap_host' => 'ldap.demodomain.com',

               # Basename, typically used for logging
               'basename' => "mailguard",
               'progname' => 'Mailguard 2.0 - Public',
              );

sub request_configuration_hash_with_name{
  $name = $_[0];
  die ("You must specify a configuration hash") unless ( $name );
  my $line = '$hash_ref=\%_' . $name ;
  eval $line;
  return $hash_ref;
}

###############################################################################
# POD Documentation
###############################################################################
=pod

=head1 EMS::Mailguard::Config

=head2 Synopsis

A place for storing some simply named hashes that contain configuration
information used by Mailguard and MailguardSession.

=head2 Constructor

Pass in a (name).  That name will have "_" prepended to it and that hash will
be returned as a reference

=head2 AUTHOR

Steven G. Harms (stharms@cisco.com)

=cut

return 1;
